<%@page import="javax.portlet.PortletURL"%>
<%@page import="com.bkav.portal.potlet.model.Employee"%>
<%@page import="java.util.List"%>
<%@page import="com.bkav.portal.potlet.model.Employee"%>
<%@page import="java.util.List"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="com.bkav.portal.potlet.service.EmployeeLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="com.bkav.portal.potlet.service.EmployeeLocalServiceUtil"%>

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>

<portlet:defineObjects />
<b>Employee Home</b>
<%@ include file="/html/employee/init.jsp"%>
<portlet:renderURL var="addEmployeeURL">
	<portlet:param name="jspPage" value="/html/employee/add.jsp" />
</portlet:renderURL>
<br />
<a href="<%=addEmployeeURL%>">Add new Employee &raquo;</a>
<br />
<hr />
<!-- --------------------------------------------------------------------- -->
<%
	List<Employee> listEmployee = EmployeeLocalServiceUtil.getEmployees(0, 100);
%>

<%
	PortletURL iteratorURL= renderResponse.createRenderURL();
iteratorURL.setParameter("jspPage", "/html/employee/view.jsp");
%>

<liferay-ui:search-container delta="20" iteratorURL="<%=iteratorURL%>">
	<liferay-ui:search-container-results
		results="<%=ListUtil.subList(listEmployee, searchContainer.getStart(),searchContainer.getEnd())%>"
		total="<%=listEmployee.size() %>" />
	<liferay-ui:search-container-row
		className="com.bkav.portal.potlet.model.Employee" modelVar="employee"
		rowVar="">
		<liferay-ui:search-container-column-text name="Id" align="left"
			value="<%=StringUtil.valueOf(employee.getEmployeeId())%>" />
		<liferay-ui:search-container-column-text name="Name" align="left"
			value="<%=employee.getEmployeeName()%>" />
		<liferay-ui:search-container-column-text name="Des" align="left"
			value="<%=employee.getEmployeeDesc()%>" />
		<liferay-ui:search-container-column-text name="Job" align="left"
			value="<%=employee.getEmployeeJob()%>" />
	</liferay-ui:search-container-row>
	<liferay-ui:search-iterator searchContainer="<%=searchContainer%>"
		paginate="true" />

</liferay-ui:search-container>
<br />
<br />
<br />
<hr />